1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to coding a motion vector in a multimedia image codec, and more particularly to bit allocation for coding a motion vector.
2. Description of the Related Art
Various types of imaging media devices capable of transmitting images are available, the imaging media devices being able to transmit images at data rates which are mutually different. In addition, since terminals receiving an image from an imaging media device provide various resolutions to users, image data having data rates suitable for the terminals are required. To this end, a method for allowing an image data provider to hold and provide a plurality of pieces of image data according to the respective resolutions may be used.
However, this solution limits the available storage space. In contrast, when image data has been encoded using an image compression standard, the image data can be extracted according to the data rate of each media device and the resolution of the user terminal, and then provided to the user. Software or an algorithm for compressing or decompressing data, as described above, is called a codec.
Image codecs used in the multimedia field including a still image or moving image use a static bit allocation scheme for allocating a small number of bits based on the case of “(mvd_x, mvd_y)=(0,0)” regardless of the characteristics of the image, when coding the value of a difference vector “mvd”, which represents the difference between adjacent motion vectors.
With respect to image data, such as a still image or moving image, in the multimedia field, the difference between the motion vectors of a screen image is designated as a difference vector “mvd,” wherein the motion vector and the difference vector “mvd” may be expressed generally as “(mvd_x, mvd_y)” along the x and y axis in a two-dimensional coordinate plane.
According to a related art motion vector coding method used by an image codec, bits are allocated on the assumption that there are almost no difference vectors. Accordingly, bit coding efficiency is degraded when a camera (or an encoder) moves during the taking of a photograph, for example when panning (photographing a moving object with a fast shutter speed), zooming (taking a photograph while moving the focus of the camera), or when a subject moves (that is, when the difference vector is not equivalent to zero).
According to the related art motion vector coding method, bit allocation is performed based on the case where the difference vector between adjacent motion vectors is zero, in such a manner that the smallest number of bits are allocated when the difference vector is zero, and the larger the difference vector, the more the bits are allocated. As described above, according to the related art motion vector coding method, when image data includes the difference vectors having a tendency to be zero, the difference in the amount of data upon coding is small, but the amount of data upon coding increases when image data includes many difference vectors which have a tendency to be greater than zero.